package com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.controller;

import com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.vo.TowerNoticePersonSearchVO;
import com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.vo.TowerNoticePersonVO;
import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.service.TowerNoticePersonService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.vo.TowerNoticePersonPageVO;
import com.jxdinfo.hussar.cloud.module.example.tjjc.towernoticeperson.model.TowerNoticePerson;
import org.springframework.beans.factory.annotation.Autowired;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;

import java.util.List;

/**
 * 塔机通知人员控制器
 */
@RestController(value = "tjjc.towernoticeperson.TowerNoticePersonController")
@AuditLog(moduleName = "塔机通知人员")
@RequestMapping(value = "/tjjc/towerNoticePerson")
public class TowerNoticePersonController extends HussarBaseController<TowerNoticePerson, TowerNoticePersonService> {

    private static final Logger logger = LoggerFactory.getLogger(TowerNoticePersonController.class);

    @Autowired
    private TowerNoticePersonService towerNoticePersonService;

    /**
     * 塔机通知人员分页查询
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("findByPage")
    public ApiResponse<TowerNoticePersonPageVO> findByPage(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.findByPage(towerNoticePersonSearchVO);
    }

    /**
     * 塔机通知人员条件查询
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("findByList")
    public ApiResponse<List<TowerNoticePersonVO>> findByList(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.findByList(towerNoticePersonSearchVO);
    }

    /**
     * 塔机通知查询已读人员
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("findNoticePerson")
    public ApiResponse<String> findNoticePerson(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.findNoticePerson(towerNoticePersonSearchVO);
    }

    /**
     * 塔机通知人员新增
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("add")
    public ApiResponse<String> add(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.add(towerNoticePersonSearchVO);
    }

    /**
     * 塔机通知人员修改
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("update")
    public ApiResponse<String> update(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.updateTowerNoticePerson(towerNoticePersonSearchVO);
    }

    /**
     * 塔机通知人员删除
     *
     * @param towerNoticePersonSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "塔机通知人员", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("deleteById")
    public ApiResponse<String> deleteById(@RequestBody TowerNoticePersonSearchVO towerNoticePersonSearchVO) {
        //todo 没有获取项目编号工具类
        return towerNoticePersonService.deleteById(towerNoticePersonSearchVO);
    }
}
